/*
 * @lc app=leetcode.cn id=1 lang=cpp
 *
 * [1] 两数之和
 */

// @lc code=start
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        //
        unordered_map<int ,int> indices;

        for(int i = 0; i < nums.size() ;i++){
            if(indices.find(target-nums[i]) != indices.end()  ){
                return {indices[target -nums[i]],i};
            }
            indices[nums[i]] = i;
            
        } 
        return {};
    }
};
// @lc code=end

